﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BO;
using BO.Admin;

namespace Admin
{
    public partial class AddNews : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            PerformAddNews();
        }

        private void PerformAddNews()
        {
            string NewsName = "Bài viết mới " + DateTime.Now.ToString(PublicConstants.VietnameseShortDateFormat);
            int result = News_Helper.AddDump(NewsName);
            if (result > 0) Response.Redirect("/EditNews.aspx?newsid=" + result);
            else Response.Redirect("/ListNews.aspx");
        }
    }
}
